<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>zzhao</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<link rel="stylesheet" href="umeditor/themes/default/css/umeditor.css" />
<script type="text/javascript" src="umeditor/third-party/jquery.min.js"></script>
<script type="text/javascript" src="umeditor/umeditor.config.js"></script>
<script type="text/javascript" src="umeditor/umeditor.min.js"></script>
<script type="text/javascript" src="umeditor/lang/zh-cn/zh-cn.js"></script>

<link rel="shortcut icon" href="img/ali.gif" type="image/gif" />
<link rel="stylesheet" type="text/css" href="css/chat1.css" />
<script type="text/javascript" src="js/WebSocket.js"></script>
<script type="text/javascript" src="js/chat.js"></script>

</head>
<body>
<body class="keBody">
	<h1 class="keTitle">Chat</h1>
	<div class="kePublic">
		<!--效果html开始-->
		<div class="content">
			<div class="chatBox">
				<div class="chatLeft">
					<div class="chat01">
						<div class="chat01_title">
							<ul class="talkTo">
								<li><a id="href_name" href="javascript:;">All</a></li>
							</ul>
							<a class="close_btn" href="javascript:;" onclick="close()"></a>
						</div>
						<div id="message_box" class="chat01_content">
							<div id="All" class="message_box" style="display: block;"></div>
						</div>
					</div>
					<div class="chat02">
						<div class="chat02_content">
							<textarea id="textarea"></textarea>
						</div>
						<div class="chat02_bar">
							<ul>
								<li style="right: 5px; top: 5px;"><a
									href="javascript:send();"> <img src="img/send_btn.jpg">
								</a></li>
							</ul>
						</div>
					</div>
				</div>
				<div class="chatRight">
					<div class="chat03">
						<div class="chat03_title">
							<label class="chat03_title_t"> 成员列表</label>
						</div>
						<div class="chat03_content">
							<ul id="userList">
								<li><label id="lab_All" class="online"> </label> <a
									href="javascript:;" onclick="change('All')"> <img
										src="images/222.jpg">
								</a><a href="javascript:;" class="chat03_name"
									onclick="change(this.innerText)">All</a></li>
							</ul>
						</div>
					</div>
				</div>
				<div style="clear: both;"></div>
			</div>
		</div>
		<!--效果html结束-->
	</div>
	<div class="keBottom"></div>
	<script type="text/javascript" charset="utf-8">
		var current;
		var um = UM.getEditor('textarea', {
			initialFrameHeight : 100,
			initialFrameWidth : 482,
			maximumWords : 1000,
			autoHeightEnabled : false
		});
		um.addListener("keydown", function(type, event) {
			current = document.getElementById("href_name").innerText;
			var count = users.indexOf(current);
			if (count + 1 <= users.length) {
				if (13 === event.keyCode) {
					send();
				} else if (40 == event.keyCode) { //下
					if (users[count + 1] == username)
						count++;
					if (users[count + 1])
						change(users[count + 1]);
				} else if (38 == event.keyCode) {
					if (users[count - 1] == username)
						count--;
					if (users[count - 1])
						change(users[count - 1]);
				}
			}
		})
	</script>
<body>
</html>
